﻿
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sproc_CloseMailAttachFlag]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [dbo].[sproc_CloseMailAttachFlag];
GO
CREATE PROCEDURE [dbo].[sproc_CloseMailAttachFlag]
/*
===============================================
功能:    除去邮件添加附件状态
参数:
    无
注释:    每个邮件是通过DOCSIGN来表示是自己的上传
    的附件
===============================================
*/
AS
    UPDATE UDS_DOCUMENT SET DOCATTRIBUTE =0,DOCSIGN = 0 WHERE DOCATTRIBUTE =1 AND DOCSIGN = @@SPID